<?php

// Allow easy console colloring
require_once 'Console/Color.php';

$defaultModelMapperExtends = 'Application_Model_Base_BaseMapper';
$defaultModelExtends       = 'Application_Model_Base_Base';

function getOverride($type, $name, $defaultValue)
{
   static $overrides = array(
      'EXTENDS' => array(
         'SubClass'                 => 'Application_Model_ParentClass',    // The model Application_Model_SubClass will extend Application_Model_ParentClass instead of the default
      ),
      'MODEL_SET_OVERRIDES' => array(
         'User' => array('Definition', 'Value'),                           // In the model Application_Model_User the functions setDefinition and setValue will not be auto generated - it is up to the programmer to create these functions
      ),
      'MODEL_GET_OVERRIDES' => array(
         'User' => array('Definition', 'Value'),                           // In the model Application_Model_User the functions getDefinition and getValue will not be auto generated - it is up to the programmer to create these functions
      )
   );

   if(!isset($overrides[$type]))
      return $defaultValue;
   
   $typeArray = $overrides[$type];

   if(!isset($typeArray[$name]))
      return $defaultValue;

   // Echo the change from default behavior
   echo Console_Color::convert("\t%cOverride Found For: %n$type:$name %c- NewValue: %n" . $typeArray[$name] . "\n");
   return $typeArray[$name];
}

function generateCopyright()
{
   // The string returned from this function will be placed at the top of each model file.
   $year = date("Y");
   return "/***********************************************************************
/*   Copyright <YOUR COMPANY NAME HERE> $year All Rights Reserved.   *
/*                                                                     *
/*     THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION     *
/*     WHICH IS THE PROPERTY OF <YOUR COMPANY NAME HERE>  CORPORATION OR ITS     *
/*             LICENSORS AND IS SUBJECT TO LICENSE TERMS.              *
/**********************************************************************/
";
}
